package com.skywolf.chem.article.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.skywolf.chem.article.entity.ContestNotice;
import com.skywolf.chem.article.pojo.ContestQueryParam;
import com.skywolf.chem.article.service.IContestNoticeService;
import com.skywolf.chem.common.sysconfig.pojo.vo.PageVO;
import com.skywolf.chem.common.sysconfig.response.RespData;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 赛事预告信息表 前端控制器
 * </p>
 *
 * @author 
 * @since 2020-07-01
 */
@RestController
@RequestMapping("/ct/article/contest-notice")
public class ContestNoticeController {

    @Autowired
    IContestNoticeService contestNoticeService;

    @ApiOperation(value = "获取赛事预告列表",notes = "获取赛事预告列表")
    @RequestMapping(value = "/getLiveNotice",method = {RequestMethod.POST},produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public RespData<ContestNotice> getLiveNotice(@RequestBody @Validated ContestQueryParam queryParam) {
        IPage<ContestNotice> page = contestNoticeService.liveNoticePageList(queryParam);
        PageVO<ContestNotice> pageVO = new PageVO<>(page);
        return RespData.success(pageVO);
    }
}
